cmake_minimum_required(VERSION 3.16)
project(NetWorkLearnClient LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# set(CMAKE_AUTOUIC_OUTPUT_DIR "${CMAKE_BINARY_DIR}/generated_ui_files")

set(AUTOGEN_BUILD_DIR "${CMAKE_BINARY_DIR}/generated_ui_files")

# 设置静态库导出路径
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
# 设置动态库导出路径
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
# 设置可执行文件导出路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

include(qt.cmake)

# CMAKE_MODULE_PATH 用于指定查找模块文件（如 FindBoost.cmake）的路径。对应find_package的 Module mode
list(APPEND CMAKE_MODULE_PATH "C:/Qt/5.15.0/msvc2019_64")
# CMAKE_PREFIX_PATH 用于指定查找库和头文件（如 BoostConfig.cmake）的路径。对应find_package的 Config mode
list(APPEND CMAKE_PREFIX_PATH  "C:/Qt/5.15.0/msvc2019_64")
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR}
    COMPONENTS
        Core
        Gui
        Widgets
        network
)


qt_standard_project_setup()

add_subdirectory("./3rd")
add_subdirectory("./src")